<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
  class Person{
    constructor(name) {
        this.name = name
    }
    sayHi(){
        console.log('HI')
    }
  }

  class Stu extends Person{
      constructor(name,age) {
          super(name);
          this.age = age
      }
      eat(){
          console.log('eat')
      }
  }

  const p1 = new Person('zhangsan')
  console.log(p1)
  console.dir(Person)
  const s1 = new Stu('lisi',20)
  console.log(s1)
  console.dir(Stu)
  // Stu.__proto__===>Person
  console.log(Stu.__proto__===Person)//true
//  Person.__proto__===>Object.prototype

  function Person1(){
  }
  Person1.prototype.sayHi=function (){
      console.log('Hi')
  }
  function Stu1(){
  }
  Stu1.prototype = Object.create(Person1)
  // console.dir(Person1)
  console.dir(Stu1)
</script>
</body>
</html>